UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UaND3Tw1tA+rk23898IKDUMhppTAr4mOwdVY2iBmm4s=' 
WHERE 
  key_id = 'fa3db64f9f80317849673bd27eb941f0539e923006f967746135394a4371bd47' 
  AND (
    token = 'UaND3Tw1tA+rk23898IKDUMhppTAr4mOwdVY2iBmm4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029