UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/Fjv3vDlTzuwlAHcGCEecSDNNCJ6jgEOogwfH0NxO5M=' 
WHERE 
  key_id = '0a881317022d73c93d7daa9b79211e5cb18643ee16001632d8f08b879ab5523c' 
  AND (
    token = '/Fjv3vDlTzuwlAHcGCEecSDNNCJ6jgEOogwfH0NxO5M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031