UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5XqgDgwT5l6iCwMpeIOeOjJUxNXExg5YE2hkGheRa1s='
WHERE
key_id = '70a0f5851e503f2ed5c83153782959103c84c1375277cd256e71206e9e8074ea'
AND (
token = '5XqgDgwT5l6iCwMpeIOeOjJUxNXExg5YE2hkGheRa1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)