UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hLX/KBgKh2takAFQTLZNIRk1nHrrbmV110lsqqmMAn8=' 
WHERE 
  key_id = 'd3d61846d900c07972b27db615808c3bf3e7d9705e74b6a2eee883b42c7601b7' 
  AND (
    token = 'hLX/KBgKh2takAFQTLZNIRk1nHrrbmV110lsqqmMAn8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026