UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DZb3mQwQgkhJXCc30ITIclIpJcmTyotykSI4RdkhMUQ='
WHERE
key_id = '44dfced8190d14d7489ee2e79f88d8aa5f2fd6e4885da6748fe90e5a4c2c20a6'
AND (
token = 'DZb3mQwQgkhJXCc30ITIclIpJcmTyotykSI4RdkhMUQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)