UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'trofiTqa0sEqcVrOVFzrXpHWBlOErxmEIwQr6vsJKpw='
WHERE
key_id = 'b573646f5c6e969731a367447d787c62fe38bd97a6e541df5f8adf00e478eab7'
AND (
token = 'trofiTqa0sEqcVrOVFzrXpHWBlOErxmEIwQr6vsJKpw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)