UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U0uuKMZQ4d+bMj6iqaniKd3csL21WMdg5VUQ5iByJ08='
WHERE
key_id = '59c1b1dd483d788264d62d9dc53421047b27b4b26154b07bde467f1abc513622'
AND (
token = 'U0uuKMZQ4d+bMj6iqaniKd3csL21WMdg5VUQ5iByJ08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)