UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KvcixnFX8j8754I9QYBZzxx0GYP3NcGiWhuCbwZ/Grk='
WHERE
key_id = '164ba4f3c412d98a43c3e44bb5841ea6d95e1ca33106d70fb7ec5e80b3e1eda9'
AND (
token = 'KvcixnFX8j8754I9QYBZzxx0GYP3NcGiWhuCbwZ/Grk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)