UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lj0ZKUayg87tqIvdu5jvBDyhlgACNyhgxqqtZhz/uR8='
WHERE
key_id = '280d64d204dcf1f761f535015a8bfd50a3c018eabe48642254ca5000f931d74a'
AND (
token = 'lj0ZKUayg87tqIvdu5jvBDyhlgACNyhgxqqtZhz/uR8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)