UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2GLyBswqxgRE89QaePQAq7ZnUuPP76Ml2V/4dLWW+Hs=' 
WHERE 
  key_id = '287db30bc57093594b2e3305e79a60dae033a41ab7fa1cd00bc87b8fdd9a319c' 
  AND (
    token = '2GLyBswqxgRE89QaePQAq7ZnUuPP76Ml2V/4dLWW+Hs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031