UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LUjlvqCRLQmXixNGg57qMt5JQblAteSb1ghJzJTpNco='
WHERE
key_id = '6883fa11b4b0e0c10cc083ff2998560e1c61c1fa39f0d5f7aa76a3e9477c7dd2'
AND (
token = 'LUjlvqCRLQmXixNGg57qMt5JQblAteSb1ghJzJTpNco='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)