UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EBEwFm77FGigYCF9k9dJAhORsPwelA9uc3dzrfo/hEU='
WHERE
key_id = 'e880c5e9f1ca2970f7114b02caa8890757ed837984841b9c259ac163e1f2562b'
AND (
token = 'EBEwFm77FGigYCF9k9dJAhORsPwelA9uc3dzrfo/hEU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)