UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Snq37ME7DzmMxzrNiPZuql54nPhXV0IJwcz1VwbQsw8='
WHERE
key_id = 'fc1f8c85c0b54d7b57c524f21e2166898d2d3d2c3e5adc04d7185c4c82d6fec7'
AND (
token = 'Snq37ME7DzmMxzrNiPZuql54nPhXV0IJwcz1VwbQsw8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)