UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q6hRMe/Wp6DXoDBq/HiYpkLj4wm+H1x3/jQaIp0FYXE=' 
WHERE 
  key_id = '145b045e350cb1d6a2b017f1217eacd7f9bb78eb8ba01b52e2a4c8c10172df8f' 
  AND (
    token = 'Q6hRMe/Wp6DXoDBq/HiYpkLj4wm+H1x3/jQaIp0FYXE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042