UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nf7XfIUMrVN3b9BRaHF5VxJ5aEbFx2l/DjUIr031cyI='
WHERE
key_id = 'e05a026106711c1d95231615676672c83f7131cef8ed56f67cefff14940123c2'
AND (
token = 'Nf7XfIUMrVN3b9BRaHF5VxJ5aEbFx2l/DjUIr031cyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)