UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I+1u99xDKu1HS3dvko/i37PzhLck1m5d5Cj/WLrBNaI=' 
WHERE 
  key_id = '2a945627ac9b7d3bb4420aece10bd4e1ca88527c85639adac2b10541d0a2688e' 
  AND (
    token = 'I+1u99xDKu1HS3dvko/i37PzhLck1m5d5Cj/WLrBNaI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00070