UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/+9ajjPZnkwdSkkUxzTGRopOuyVN+kImrYvhUX3am0E=' 
WHERE 
  key_id = '377b040ea749be220433ba0ce59b4bbf2acfbbe5cabfb5c1f8be40c8ef8c4609' 
  AND (
    token = '/+9ajjPZnkwdSkkUxzTGRopOuyVN+kImrYvhUX3am0E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028