UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b3Kt3V0iB3YCwM8Ysa0659qWKB6hEy7kVdSLl976l/o='
WHERE
key_id = '41e7ae1a52f5aac3d67ebc9a156f3a46b087c0912bedeecdd231105f0d4b860f'
AND (
token = 'b3Kt3V0iB3YCwM8Ysa0659qWKB6hEy7kVdSLl976l/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)