UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bzd6H2MQaRPOXLhSweD+Aum9CQOXnbMlSQMm86N4uOg=' 
WHERE 
  key_id = '3cdab3508bd3be8224328ba18705dc72ca50345ee481c54726437a1afdd347c5' 
  AND (
    token = 'bzd6H2MQaRPOXLhSweD+Aum9CQOXnbMlSQMm86N4uOg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032