UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QqvGKDYy3+yfyDxNpPChHIgksZmpSotdUXL5V9DtiYw=' 
WHERE 
  key_id = '21625cf7d5834291b4861ec8136a74d611cdc22db2b287b1ffcf372b396c71a3' 
  AND (
    token = 'QqvGKDYy3+yfyDxNpPChHIgksZmpSotdUXL5V9DtiYw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041