UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TSITydaw3oaU4wdSGHhuwnqrxhk82sTG9jbWIgbEmw0=' 
WHERE 
  key_id = '44b6ee4fdf6acca33834207d742647ac1d0b41213b53a9e90dc985e87f337694' 
  AND (
    token = 'TSITydaw3oaU4wdSGHhuwnqrxhk82sTG9jbWIgbEmw0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028