UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2u1+gmhsny7QVssVSzGnOAX/7It0+Ip0ajDMuU0ZHNA='
WHERE
key_id = '855b6503dbdc32c301e9fd95df6df7c0998ac447af2fb45f7b5a3055037734da'
AND (
token = '2u1+gmhsny7QVssVSzGnOAX/7It0+Ip0ajDMuU0ZHNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)