UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3QzxCa2qef71w14yzD+4DmTVH1SOtI3pZ7lReaImwEc=' 
WHERE 
  key_id = 'a4a2b6a38e23d46b453a32227ae90a52b1d16a98ae512ca38425d681901ca8b0' 
  AND (
    token = '3QzxCa2qef71w14yzD+4DmTVH1SOtI3pZ7lReaImwEc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039