UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5RAgVTgXhxaopKLfm59BwXxJjg5sVGpKK2hQS++Kqik='
WHERE
key_id = '65d1cf83b763499613b0563f82cac740d258246d0c1fb034512a1989b193d353'
AND (
token = '5RAgVTgXhxaopKLfm59BwXxJjg5sVGpKK2hQS++Kqik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)