UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8qTR8cJyiFVhkkoYDmTzera4RlHCr0e3phZhb+sLADA='
WHERE
key_id = '8f8deca796badd9f6716f2151fe2beac1aa8ce150f9ee08992e685936eef3776'
AND (
token = '8qTR8cJyiFVhkkoYDmTzera4RlHCr0e3phZhb+sLADA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)