UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6JJNZ8ddSmato2U9JOrx/eumYRsPx1dJ5/PLxDGXZBs='
WHERE
key_id = '4a6c1af3b332df3b95980ef6b4d4e6f1b92d6906b63cac4e8f22df5bfc3cd994'
AND (
token = '6JJNZ8ddSmato2U9JOrx/eumYRsPx1dJ5/PLxDGXZBs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)