UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W92KAQRnNZGcpI6kihlJrXnwa0t+kwWeGlRJ4jtzc8c='
WHERE
key_id = 'b65b6b82d277ca73adc7966ee9c3382279907bd3b207731cc54a40c51d7f1a93'
AND (
token = 'W92KAQRnNZGcpI6kihlJrXnwa0t+kwWeGlRJ4jtzc8c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)