UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TeZvg3pjT4z1fc9MVv58R8dU2ATH2bv+apm3DtIHjno='
WHERE
key_id = '6205e4626f164a6a08a6bdcee44b934951b1ca199259364b68802e9980152933'
AND (
token = 'TeZvg3pjT4z1fc9MVv58R8dU2ATH2bv+apm3DtIHjno='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)