UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xGbNd3mPc74VZmtPNLmkWcg/X5DfcjYpkzBWHREH+iA=' 
WHERE 
  key_id = 'cef630820fa7cabcd6f38cb7c8dd32e7bab064853324b114aede42aa4134504e' 
  AND (
    token = 'xGbNd3mPc74VZmtPNLmkWcg/X5DfcjYpkzBWHREH+iA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030