UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jUjZ28oKRqjeWURFpjtXJPrkDH7L7WxIs4OFL61m4AQ='
WHERE
key_id = '789866c0e44c90720ba2054a6c2114be0f614a7e6cf9b0cff3aa4a328bead0a5'
AND (
token = 'jUjZ28oKRqjeWURFpjtXJPrkDH7L7WxIs4OFL61m4AQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)