UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QlorLmL9i2V0k2t8O/RwqIc6pF6u/T4a91W1taiKAc4='
WHERE
key_id = '00d2bfedf5999f2588aa1c0764e7db449c68fa05b0f81df6bde9bb29504a049c'
AND (
token = 'QlorLmL9i2V0k2t8O/RwqIc6pF6u/T4a91W1taiKAc4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)