UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iNtYgFABJywxWSgcIHduIHM/SK4i/V+zu6tia2XJl1E='
WHERE
key_id = 'c1f829552306bd7560bbbbd933ac47e24fa3bbde29725dfa350a61e48a9acae0'
AND (
token = 'iNtYgFABJywxWSgcIHduIHM/SK4i/V+zu6tia2XJl1E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)